<?php
require_once("../util/db.php");
$username = $_POST['username'];
$password1 = $_POST['password1'];
$password2 = $_POST['password2'];

$sql = "UPDATE user SET password ='$password2' WHERE username = '$username' AND password = '$password1'";

echo $sql;
$retaval = mysqli_query($conn,$sql);

var_dump($retaval);

if (mysqli_affected_rows($conn)) {
    header('Location: ../pages/Neastelogin.html?flag=200&msg=修改成功');
}else{
    header('Location: ../pages/Neaste163reset.html?flag=204&msg=修改失败');
}

mysqli_close($conn);